******************************Figure 1******************************************
use "data.dta", clear
drop if ep==7
replace npedvol=npedvol*100
gen axis=_n+0 in 2/6
gen avg_npedvol=.
gen ll_npedvol=.
gen ul_npedvol=.


forvalues e=2(1)6{
qui summ npedvol if ep==`e'
replace avg_npedvol=r(mean) if axis==`e'
replace ll_npedvol=r(mean)-(r(sd)/2) if axis==`e'
replace ul_npedvol=r(mean)+(r(sd)/2) if axis==`e'
}
*

twoway (rspike ll_npedvol ul_npedvol axis) (scatter avg_npedvol axis, ///
xtitle(European Parliament) ytitle(Pct. EU Election Volatility) ///
legend(order(2 "Average" 1 "Standard Deviation")) ///
graphregion(color(white) ) scheme(s2mono) )



******************************Figure 2******************************************
use "data.dta", clear

histogram epgiwrice, graphregion(color(white) ) scheme(s2mono) name(k1, replace) ///
xtitle("Individual Weighted Rice Score") legend(off)

histogram wtsidewnp , graphregion(color(white) ) scheme(s2mono) name(k2, replace) ///
xtitle("Weighted Side with National Party") legend(off)

graph combine k1 k2,  scheme(s2mono) graphregion(color(white) )

*********************************Figure 3***************************************

use "data.dta", clear
gen axis=_n+0 in 2/6
gen avg_epgiwrice=.
gen ll_epgiwrice=.
gen ul_epgiwrice=.

gen avg_wtsidewnp=.
gen ll_wtsidewnp=.
gen ul_wtsidewnp=.


forvalues e=2(1)6{
qui summ epgiwrice if ep==`e'
replace avg_epgiwrice=r(mean) if axis==`e'
replace ll_epgiwrice=r(mean)-(r(sd)/2) if axis==`e'
replace ul_epgiwrice=r(mean)+(r(sd)/2) if axis==`e'
}
*

forvalues e=2(1)6{
qui summ wtsidewnp if ep==`e'
replace avg_wtsidewnp=r(mean) if axis==`e'
replace ll_wtsidewnp=r(mean)-(r(sd)/2) if axis==`e'
replace ul_wtsidewnp=r(mean)+(r(sd)/2) if axis==`e'
}
*

twoway (rspike ll_epgiwrice ul_epgiwrice axis) (scatter avg_epgiwrice axis, ///
xtitle(European Parliament) ytitle("Ind. Weighted Rice") ///
legend(order(2 "Average" 1 "Standard Deviation") size(small)) ///
graphregion(color(white) ) scheme(s2mono) name(t1, replace))



twoway (rspike ll_wtsidewnp ul_wtsidewnp axis) (scatter avg_wtsidewnp axis, ///
xtitle(European Parliament) ytitle("Wt. Side w. N.Party") ///
legend(order(2 "Average" 1 "Standard Deviation")) ///
graphregion(color(white) ) scheme(s2mono) name(t2, replace) )

grc1leg t1 t2, legendfrom(t1) cols(1) graphregion(color(white) ) scheme(s2mono)
